package itbour.onetouchshow.singlecase;

import com.google.gson.Gson;

import java.util.ArrayList;
import java.util.List;

import itbour.onetouchshow.bean.AppBanner;
import itbour.onetouchshow.bean.HomeDetailslBean;
import itbour.onetouchshow.bean.VipInfoBean;
import itbour.onetouchshow.bean.inching.noppt.InchingCoreRootNoPPTV10Bean;
import itbour.onetouchshow.bean.inching.noppt.InchingDocStringNoPPTV10Bean;
import itbour.onetouchshow.constants.AppConst;
import itbour.onetouchshow.utils.SpUtils;

/**
 * Created by zjl_d on 2017/11/23.
 */

public enum InchingDataSingleCase {

    INSTANCE;
    ArrayList<ArrayList<String>> tableSourceData;
    private InchingDocStringNoPPTV10Bean instance;
    private ArrayList<InchingCoreRootNoPPTV10Bean> deleteList = new ArrayList<>();
    private HomeDetailslBean.TextConfigBean textConfig;
    private HomeDetailslBean.AppControl appControl;
    private HomeDetailslBean.LengthControl lengthControl;
    private AppBanner appBanner;
    private float scale;
    private long duration;
    private String baseInfo;
    private HomeDetailslBean homeDetailslBean;
    private VipInfoBean vipInfoBean;
    private List<List<Integer>> colorList;
    private List<HomeDetailslBean.FontListBean> fontList;

    public VipInfoBean getVipInfoBean() {
        return vipInfoBean;
    }

    public void setVipInfoBean(VipInfoBean vipInfoBean) {
        this.vipInfoBean = vipInfoBean;
    }

    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    public float getScale() {
        return scale;
    }

    public HomeDetailslBean.TextConfigBean getTextConfig() {
        return textConfig;
    }

    public void setTextConfig(HomeDetailslBean.TextConfigBean textConfig) {
        this.textConfig = textConfig;
    }

    public InchingDocStringNoPPTV10Bean getInstance() {
        baseInfo = SpUtils.getInstance().getString(AppConst.APPBASEINFO);
        if (null != baseInfo) {
            homeDetailslBean = new Gson().fromJson(baseInfo, HomeDetailslBean.class);
        }
        return instance;
    }

    public void setInstance(InchingDocStringNoPPTV10Bean tgAndFineTuneInfoV53Bean) {
        this.instance = tgAndFineTuneInfoV53Bean;
    }

    public ArrayList<InchingCoreRootNoPPTV10Bean> getDeleteList() {
        return deleteList;
    }

    //退出的时候重置数据
    public void setThisNull() {
        instance = null;

    }

    public void clearSaveTableData() {
        tableSourceData = null;
    }

    public List<List<Integer>> getColorList() {
        return colorList;
    }

    public List<HomeDetailslBean.FontListBean> getFontList() {
        return fontList;
    }

    public void setFontColorList(List<List<Integer>> colorList) {
        this.colorList = colorList;
    }

    public void setFontTypeList(List<HomeDetailslBean.FontListBean> fontList) {
        this.fontList = fontList;
    }

    public void setNowScale(float scale) {
        this.scale = scale;
    }

    public HomeDetailslBean.AppControl getAppControl() {
        if (appControl == null && homeDetailslBean != null) {
            appControl = homeDetailslBean.getAppControl();
        }
        return appControl;
    }

    public void setAppControl(HomeDetailslBean.AppControl appControl) {
        this.appControl = appControl;
    }

    public ArrayList<ArrayList<String>> getNowTableData() {
        return tableSourceData;
    }

    public void setNowTableData(ArrayList<ArrayList<String>> tableSourceData) {
        this.tableSourceData = tableSourceData;
    }

    public HomeDetailslBean.LengthControl getLengthControl() {
        if (lengthControl == null && homeDetailslBean != null) {
            lengthControl = homeDetailslBean.getLengthControl();
        }
        return lengthControl;
    }

    public void setLengthControl(HomeDetailslBean.LengthControl lengthControl) {
        this.lengthControl = lengthControl;
    }

    public AppBanner getAppBanner() {
        return appBanner;
    }

    public void setAppBanner(AppBanner appBanner) {
        this.appBanner = appBanner;
    }
}
